import request from '@/utils/request.js'

const prefix = '/api/appoint'

// 获取教练的课程排期
export function coachAppointList(coachId,date) {
	return request({
		url: prefix + '/coachAppointList/'+ coachId+'/' + date,
		method: 'get',
	})
}

/**
 * 获取普通用户的课程排期
 * @param {Object} courseId
 */
export function mineAppointList(date) {
	return request({
		url: prefix + '/mineAppointList/' + date,
		method: 'get',
	})
}

/**
 * 获取用户所有课程排期
 */
export function mineAppointAllList(courseId) {
	return request({
		url: prefix + '/mineAppointAllList/'+courseId,
		method: 'get',
	})
}
/**
 * 获取课程学员
 * @param {Object} courseId
 */
export function courseUserList(courseId) {
	return request({
		url: prefix + '/courseUserList/' + courseId,
		method: 'get',
	})
}
// 新增课程排期
export function addAppoint(data) {
	return request({
		url: prefix + '/addAppoint',
		method: 'post',
		data: data
	})
}
/**
 * 同意
 * @param {Object} id
 */
export function passAppoint(id) {
	return request({
		url: prefix + '/pass/'+ id,
		method: 'put',
	})
}
/**
 * 批量同意
 * @param {Object} ids
 */
export function batchPassAppoint(data) {
	return request({
		url: prefix + '/batchPass',
		method: 'post',
		data: data
	})
}
/**
 * 拒绝
 * @param {Object} id
 */
export function rejectAppoint(id) {
	return request({
		url: prefix + '/reject/'+ id,
		method: 'put',
	})
}
